package com.jubaozan.c3.goods.controller;


import com.jubaozan.c3.feign.service.UserFeignService;
import com.jubaozan.c3.feign.vo.UserVO;
import com.jubaozan.c3.goods.vo.GoodsVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yuanjie
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    private final UserFeignService userService;

    public GoodsController(final UserFeignService userService) {
        this.userService = userService;
    }

    @GetMapping("/getUserById")
    public UserVO getUserById() {
        return userService.getUserById(1L);
    }

    @GetMapping("/{id}")
    public GoodsVO getGoodsById() {
        GoodsVO goods = new GoodsVO();
        goods.setId(1L);
        goods.setName("测试商品");
        return goods;
    }
}
